#ifndef HOTKEYBAR_H
#define HOTKEYBAR_H

#include <QLineEdit>
#include <QKeyEvent>
#include "keystring.h"

class HotKeyBar : public QLineEdit
{
    Q_OBJECT
public:
    explicit HotKeyBar(QWidget *parent = 0);

    void setHotKey(Qt::Key key, Qt::KeyboardModifiers mode);
    void setShowText(Qt::Key key, Qt::KeyboardModifiers mode);
    void setKeyString(KeyString* pKeyString);

private:
    void focusInEvent(QFocusEvent *e);          //获取焦点
    void focusOutEvent(QFocusEvent *e);         //失去焦点
    void keyPressEvent(QKeyEvent *event);
signals:
void sgn_hotKeyChanged(Qt::Key key,Qt::KeyboardModifiers mod);
public slots:

private:
    Qt::KeyboardModifiers mKeymod;
    Qt::Key mKeyval;

    KeyString *mpKeystring;
};

#endif // HOTKEYBAR_H
